#include <asm.h>
#include <regdef.h>
#include <inst_test.h>

LEAF(n67_swl_test)
    .set noreorder
    addiu s0, s0, 1
    li  s2, 0x0
###test inst
    TEST_SWL(0xceeb5200, 0x8ea80e00, 0x800d0000, 0x000056cd, 0x000056cc, 0xceeb8ea8)
    TEST_SWL(0xcb3c1100, 0xe2b9de40, 0x800d0000, 0x0000d5a4, 0x0000d5a4, 0xcb3c11e2)
    TEST_SWL(0x4e2e485c, 0xf16b41e8, 0x800d0000, 0x000050e2, 0x000050e0, 0x4ef16b41)
    TEST_SWL(0x1bce2cd7, 0x6366c83b, 0x800d0000, 0x0000a19c, 0x0000a19c, 0x1bce2c63)
    TEST_SWL(0xdb3b327c, 0x5be30aa0, 0x800d0000, 0x0000d998, 0x0000d998, 0xdb3b325b)
    TEST_SWL(0x2c29e090, 0xbde2bd60, 0x800d0000, 0x0000fd1b, 0x0000fd18, 0xbde2bd60)
    TEST_SWL(0x60b55ce8, 0x561e7c08, 0x800d0000, 0x0000b820, 0x0000b820, 0x60b55c56)
    TEST_SWL(0xd78e7392, 0x4632e070, 0x800d0000, 0x0000c274, 0x0000c274, 0xd78e7346)
    TEST_SWL(0x3a420264, 0xa3025d50, 0x800d0000, 0x00009758, 0x00009758, 0x3a4202a3)
    TEST_SWL(0x1c1775d0, 0x5fd1c3c4, 0x800d0000, 0x0000e010, 0x0000e010, 0x1c17755f)
    TEST_SWL(0x2b087980, 0x8731ec0c, 0x800d0000, 0x0000a5c8, 0x0000a5c8, 0x2b087987)
    TEST_SWL(0x41148506, 0xbaf7b470, 0x800d0000, 0x0000b9ac, 0x0000b9ac, 0x411485ba)
    TEST_SWL(0xa3e95600, 0x60d22140, 0x800d0000, 0x00007d55, 0x00007d54, 0xa3e960d2)
    TEST_SWL(0xaf651918, 0x161bf166, 0x800d0000, 0x00006c41, 0x00006c40, 0xaf65161b)
    TEST_SWL(0xfcd06a30, 0x8b54a76d, 0x800d0000, 0x000085b8, 0x000085b8, 0xfcd06a8b)
    TEST_SWL(0xc28b6558, 0xabd19efc, 0x800d0000, 0x000090ce, 0x000090cc, 0xc2abd19e)
    TEST_SWL(0x98b071cc, 0xb4db6120, 0x800d0000, 0x0000d6e8, 0x0000d6e8, 0x98b071b4)
    TEST_SWL(0xc9442ad6, 0xbafa1d80, 0x800d0000, 0x0000113e, 0x0000113c, 0xc9bafa1d)
    TEST_SWL(0x562aa100, 0xf640d4c0, 0x800d0000, 0x00003852, 0x00003850, 0x56f640d4)
    TEST_SWL(0xd7add4e3, 0x0e5f949a, 0x800d0000, 0x00009e77, 0x00009e74, 0x0e5f949a)
    TEST_SWL(0xb6c20070, 0x01f5b980, 0x800d0000, 0x0000ff67, 0x0000ff64, 0x01f5b980)
    TEST_SWL(0x1b3485f0, 0x7e9a7db5, 0x800d0000, 0x0000d370, 0x0000d370, 0x1b34857e)
    TEST_SWL(0x69f14e30, 0xbb9353b7, 0x800d0000, 0x000048a9, 0x000048a8, 0x69f1bb93)
    TEST_SWL(0x7a0c460e, 0x247bb7ad, 0x800d0000, 0x0000d9bf, 0x0000d9bc, 0x247bb7ad)
    TEST_SWL(0xbde62868, 0xc7e25e9e, 0x800d0000, 0x0000cdc0, 0x0000cdc0, 0xbde628c7)
    TEST_SWL(0x3d566340, 0x172679a0, 0x800d0000, 0x00007659, 0x00007658, 0x3d561726)
    TEST_SWL(0xfb2d09c0, 0x44403acc, 0x800d0000, 0x0000696c, 0x0000696c, 0xfb2d0944)
    TEST_SWL(0x93bde46c, 0x2715f762, 0x800d0000, 0x00001555, 0x00001554, 0x93bd2715)
    TEST_SWL(0x4f944e94, 0xc85819a0, 0x800d0000, 0x0000d658, 0x0000d658, 0x4f944ec8)
    TEST_SWL(0x91a576e6, 0x826a1ba0, 0x800d0000, 0x0000ad10, 0x0000ad10, 0x91a57682)
    TEST_SWL(0xf28f7db0, 0x78e5f7e8, 0x800d0000, 0x00009859, 0x00009858, 0xf28f78e5)
    TEST_SWL(0x7288ff72, 0x0f89fa00, 0x800d0000, 0x0000fd42, 0x0000fd40, 0x720f89fa)
    TEST_SWL(0x9807a630, 0x2ded2de8, 0x800d0000, 0x0000d3f5, 0x0000d3f4, 0x98072ded)
    TEST_SWL(0xf8079b9e, 0x6a70879a, 0x800d0000, 0x0000e226, 0x0000e224, 0xf86a7087)
    TEST_SWL(0x1ad1ad88, 0xbc3cc5f0, 0x800d0000, 0x0000f3ec, 0x0000f3ec, 0x1ad1adbc)
    TEST_SWL(0xa3e89f2b, 0x67e2ad10, 0x800d0000, 0x00008f84, 0x00008f84, 0xa3e89f67)
    TEST_SWL(0x4be5765c, 0xf86a7910, 0x800d0000, 0x0000c702, 0x0000c700, 0x4bf86a79)
    TEST_SWL(0x4b03b9e0, 0x6f8c7906, 0x800d0000, 0x00000c9d, 0x00000c9c, 0x4b036f8c)
    TEST_SWL(0xc7eb9492, 0x108f5500, 0x800d0000, 0x0000c263, 0x0000c260, 0x108f5500)
    TEST_SWL(0xb5547030, 0x1f1045e1, 0x800d0000, 0x000049cc, 0x000049cc, 0xb554701f)
    TEST_SWL(0xb2895b80, 0xa24974bc, 0x800d0000, 0x0000279f, 0x0000279c, 0xa24974bc)
    TEST_SWL(0x8a7c539c, 0xb48a08aa, 0x800d0000, 0x00003d6a, 0x00003d68, 0x8ab48a08)
    TEST_SWL(0x6b052133, 0x19fa2251, 0x800d0000, 0x00001ce4, 0x00001ce4, 0x6b052119)
    TEST_SWL(0x4279acfc, 0x30f97394, 0x800d0000, 0x00006674, 0x00006674, 0x4279ac30)
    TEST_SWL(0xe5304558, 0xc9c328e0, 0x800d0000, 0x00007cb0, 0x00007cb0, 0xe53045c9)
    TEST_SWL(0x60f19580, 0x23025f0c, 0x800d0000, 0x00003bc6, 0x00003bc4, 0x6023025f)
    TEST_SWL(0xc4d8efb0, 0xf39af5b0, 0x800d0000, 0x00001300, 0x00001300, 0xc4d8eff3)
    TEST_SWL(0xe40f6b14, 0x9a857c70, 0x800d0000, 0x0000d4d0, 0x0000d4d0, 0xe40f6b9a)
    TEST_SWL(0xce22aec7, 0xc04b9522, 0x800d0000, 0x00004090, 0x00004090, 0xce22aec0)
    TEST_SWL(0xb1bf69c4, 0x4018f220, 0x800d0000, 0x00007ce4, 0x00007ce4, 0xb1bf6940)
    
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
inst_error:  
    sll t1, s0, 24
    or t0, t1, s3 
    sw t0, 0(s1)
    jr ra
    nop
END(n67_swl_test)
